/*
 Navicat Premium Data Transfer

 Source Server         : DataBase - 智联
 Source Server Type    : MySQL
 Source Server Version : 80021
 Source Host           : 124.238.116.123:7621
 Source Schema         : zhilian

 Target Server Type    : MySQL
 Target Server Version : 80021
 File Encoding         : 65001

 Date: 24/09/2020 14:42:57
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for td_admin
-- ----------------------------
DROP TABLE IF EXISTS `td_admin`;
CREATE TABLE `td_admin` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `account` varchar(20) NOT NULL DEFAULT '' COMMENT '登录名',
  `name` varchar(20) NOT NULL DEFAULT '' COMMENT '姓名',
  `letter` varchar(10) NOT NULL DEFAULT '' COMMENT '首字母拼音',
  `password` char(32) NOT NULL DEFAULT '' COMMENT '密码',
  `sex` varchar(50) NOT NULL DEFAULT '' COMMENT '性别',
  `birthday` date DEFAULT NULL COMMENT '生日',
  `avatar` varchar(200) DEFAULT NULL COMMENT '头像',
  `email` varchar(50) NOT NULL DEFAULT '' COMMENT '邮箱',
  `duty` varchar(255) NOT NULL DEFAULT '' COMMENT '负责业务',
  `mobile` varchar(20) NOT NULL DEFAULT '' COMMENT '手机号',
  `create_time` int unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `update_time` int unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  `is_del` tinyint NOT NULL DEFAULT '0' COMMENT '删除标记',
  `openid` varchar(50) DEFAULT NULL COMMENT '微信 openid',
  `nickname` varchar(20) DEFAULT NULL COMMENT '昵称',
  `sort` int DEFAULT NULL COMMENT '排序。数字大往前',
  `dept_id` int DEFAULT NULL COMMENT '部门ID',
  `is_valid` tinyint DEFAULT '1' COMMENT '是否启用',
  `is_super` tinyint NOT NULL DEFAULT '0' COMMENT '是否是超级管理员',
  `address` varchar(100) NOT NULL COMMENT '详细地址',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='【管理员信息】';

-- ----------------------------
-- Records of td_admin
-- ----------------------------
BEGIN;
INSERT INTO `td_admin` VALUES (1, '1001', '1001', '', '14e1b600b1fd579f47433b88e8d85291', '', NULL, NULL, '', '', '13412341234', 1573279117, 1597829012, 0, NULL, NULL, 0, NULL, 1, 0, '');
COMMIT;

-- ----------------------------
-- Table structure for td_file
-- ----------------------------
DROP TABLE IF EXISTS `td_file`;
CREATE TABLE `td_file` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(50) DEFAULT NULL,
  `type` varchar(50) DEFAULT NULL,
  `size` int DEFAULT NULL,
  `save_path` varchar(255) DEFAULT NULL,
  `ext` char(5) DEFAULT NULL,
  `create_time` int DEFAULT NULL,
  `md5` varchar(255) DEFAULT NULL,
  `is_cloud` tinyint DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='【附件信息】';

-- ----------------------------
-- Table structure for td_menu
-- ----------------------------
DROP TABLE IF EXISTS `td_menu`;
CREATE TABLE `td_menu` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(20) DEFAULT NULL,
  `pid` int DEFAULT NULL,
  `url` varchar(255) DEFAULT NULL,
  `sort` int DEFAULT NULL,
  `remark` text,
  `is_del` tinyint DEFAULT '0',
  `create_time` int DEFAULT NULL,
  `user_id` int DEFAULT NULL,
  `user_name` varchar(20) DEFAULT NULL,
  `badge` varchar(255) DEFAULT NULL,
  `icon` varchar(50) DEFAULT NULL,
  `module` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COMMENT='【菜单管理】';

-- ----------------------------
-- Records of td_menu
-- ----------------------------
BEGIN;
INSERT INTO `td_menu` VALUES (1, '平台管理', 0, '', 270, '', 0, 0, 0, '', '', 'iconfont td-shezhi2', 'admin');
INSERT INTO `td_menu` VALUES (2, '角色管理', 1, 'Role/index', 330, '', 0, 0, 0, '', '', '', 'admin');
INSERT INTO `td_menu` VALUES (3, '管理员管理', 1, 'Admin/index', 320, '', 0, 0, 0, '', '', '', 'admin');
INSERT INTO `td_menu` VALUES (4, '菜单管理', 1, 'Menu/index', 310, '', 0, 0, 0, '', '', '', 'admin');
INSERT INTO `td_menu` VALUES (6, '基本设置', 1, 'SystemConfig/system', 300, '', 0, 0, 0, '', '', '', '');
INSERT INTO `td_menu` VALUES (7, '数据库管理', 1, 'Data/index', 340, '', 0, 1562893570, 0, '', '', '', '');
INSERT INTO `td_menu` VALUES (8, '系统数据', 1, 'SystemGroup/index', 290, '', 0, 1573530690, NULL, NULL, '', '', NULL);
INSERT INTO `td_menu` VALUES (9, '配置分类', 1, 'SystemConfigTab/index', 280, '', 0, 1574244268, NULL, NULL, '', '', NULL);
COMMIT;

-- ----------------------------
-- Table structure for td_role
-- ----------------------------
DROP TABLE IF EXISTS `td_role`;
CREATE TABLE `td_role` (
  `id` smallint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL DEFAULT '',
  `pid` smallint DEFAULT NULL,
  `remark` varchar(255) DEFAULT NULL,
  `sort` int DEFAULT NULL,
  `create_time` int unsigned NOT NULL,
  `update_time` int unsigned NOT NULL,
  `is_del` tinyint NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `parentId` (`pid`) USING BTREE,
  KEY `ename` (`sort`) USING BTREE,
  KEY `status` (`is_del`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='【管理员角色】';

-- ----------------------------
-- Records of td_role
-- ----------------------------
BEGIN;
INSERT INTO `td_role` VALUES (1, '超级管理员', NULL, '', NULL, 1584951796, 1584951796, 0);
INSERT INTO `td_role` VALUES (2, '经理', NULL, '', NULL, 1584951821, 1597631065, 0);
INSERT INTO `td_role` VALUES (3, '客服', NULL, '', NULL, 1584951994, 1584951994, 0);
INSERT INTO `td_role` VALUES (4, '产品经理', NULL, '', NULL, 1588935165, 1588935165, 1);
COMMIT;

-- ----------------------------
-- Table structure for td_role_admin
-- ----------------------------
DROP TABLE IF EXISTS `td_role_admin`;
CREATE TABLE `td_role_admin` (
  `role_id` int unsigned DEFAULT NULL,
  `admin_id` int DEFAULT NULL,
  KEY `role_id` (`role_id`) USING BTREE,
  KEY `user_id` (`admin_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='【角色用户分配】';

-- ----------------------------
-- Records of td_role_admin
-- ----------------------------
BEGIN;
INSERT INTO `td_role_admin` VALUES (1, 1);
COMMIT;

-- ----------------------------
-- Table structure for td_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `td_role_menu`;
CREATE TABLE `td_role_menu` (
  `role_id` int NOT NULL,
  `menu_id` int NOT NULL,
  `read` tinyint(1) DEFAULT NULL,
  `write` tinyint(1) DEFAULT NULL,
  `admin` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='【权限菜单分配】';

-- ----------------------------
-- Records of td_role_menu
-- ----------------------------
BEGIN;
INSERT INTO `td_role_menu` VALUES (1, 1, NULL, NULL, NULL);
INSERT INTO `td_role_menu` VALUES (2, 2, NULL, NULL, NULL);
INSERT INTO `td_role_menu` VALUES (2, 3, NULL, NULL, NULL);
INSERT INTO `td_role_menu` VALUES (2, 4, NULL, NULL, NULL);
INSERT INTO `td_role_menu` VALUES (2, 5, NULL, NULL, NULL);
INSERT INTO `td_role_menu` VALUES (2, 6, NULL, NULL, NULL);
INSERT INTO `td_role_menu` VALUES (2, 7, NULL, NULL, NULL);
INSERT INTO `td_role_menu` VALUES (2, 8, NULL, NULL, NULL);
INSERT INTO `td_role_menu` VALUES (3, 9, NULL, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for td_system_config
-- ----------------------------
DROP TABLE IF EXISTS `td_system_config`;
CREATE TABLE `td_system_config` (
  `id` int NOT NULL AUTO_INCREMENT,
  `code` varchar(50) NOT NULL DEFAULT '',
  `name` varchar(50) NOT NULL DEFAULT '',
  `val` text,
  `is_del` tinyint NOT NULL DEFAULT '0',
  `sort` int DEFAULT NULL,
  `pid` int DEFAULT '0',
  `data_type` varchar(255) DEFAULT NULL,
  `config_tab_id` int DEFAULT NULL,
  `config_tab_name` varchar(20) DEFAULT NULL,
  `is_valid` tinyint DEFAULT '1',
  `field_info` varchar(50) DEFAULT NULL,
  `field_type` varchar(50) DEFAULT NULL,
  `field_param` text,
  `update_time` int DEFAULT NULL,
  `create_time` int DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  KEY `id` (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COMMENT='【系统设置】';

-- ----------------------------
-- Records of td_system_config
-- ----------------------------
BEGIN;
INSERT INTO `td_system_config` VALUES (1, 'system_name', '系统名称', '融信普惠', 0, NULL, 0, NULL, 1, '基础信息', 1, '', 'input', '', 1599655130, 1579428452);
INSERT INTO `td_system_config` VALUES (2, 'qiniu_access_key', 'Access Key', 'QthgAhROS2HrfpDv-Gbumamx1q4OHPspBGmHpAAy', 0, NULL, 0, NULL, 2, '七牛云', 1, '', 'input', '', 1587985857, 1580810045);
INSERT INTO `td_system_config` VALUES (3, 'qiniu_secret_key', 'Secret Key', '_xV9cR1hmtbLkHtM30CDcla2sjnEF1kWmKRibl7i', 0, NULL, 0, NULL, 2, '七牛云', 1, '', 'input', '', 1587985857, 1580810077);
INSERT INTO `td_system_config` VALUES (4, 'qiniu_bucket', 'Bucket', 'qianjinfu', 0, NULL, 0, NULL, 2, '七牛云', 1, '', 'input', '', 1587985857, 1580810283);
INSERT INTO `td_system_config` VALUES (5, 'qiniu_domain', '域名', 'http://qiniu.qianjinfu.3todo.com/', 0, NULL, 0, NULL, 2, '七牛云', 1, '', 'input', '', 1587985857, 1580810322);
INSERT INTO `td_system_config` VALUES (6, 'qiniu_pipeline', '管道', 'qianjinfu', 0, NULL, 0, NULL, 2, '七牛云', 1, '', 'input', '', 1587985857, 1580810406);
INSERT INTO `td_system_config` VALUES (7, '/admin/system_config/save_field_html', '', '', 0, NULL, 0, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for td_system_config_tab
-- ----------------------------
DROP TABLE IF EXISTS `td_system_config_tab`;
CREATE TABLE `td_system_config_tab` (
  `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT '配置分类id',
  `name` varchar(255) NOT NULL COMMENT '配置分类名称',
  `code` varchar(255) NOT NULL COMMENT '配置分类英文名称',
  `is_del` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '配置分类状态',
  `info` tinyint unsigned NOT NULL DEFAULT '0' COMMENT '配置分类是否显示',
  `icon` varchar(50) DEFAULT NULL COMMENT '图标',
  `type` varchar(20) DEFAULT '0' COMMENT '配置类型',
  `sort` int DEFAULT NULL COMMENT '排序',
  `is_valid` tinyint DEFAULT '1',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='【配置分类表】';

-- ----------------------------
-- Records of td_system_config_tab
-- ----------------------------
BEGIN;
INSERT INTO `td_system_config_tab` VALUES (1, '系统信息', 'base', 0, 0, '', 'system', NULL, 1);
INSERT INTO `td_system_config_tab` VALUES (2, '七牛云', 'qiniu', 0, 0, '', 'system', NULL, 1);
INSERT INTO `td_system_config_tab` VALUES (3, '默认', 'default', 0, 0, '', 'system', NULL, 1);
COMMIT;

-- ----------------------------
-- Table structure for td_system_group
-- ----------------------------
DROP TABLE IF EXISTS `td_system_group`;
CREATE TABLE `td_system_group` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '组合数据ID',
  `name` varchar(50) NOT NULL COMMENT '数据组名称',
  `desc` varchar(256) NOT NULL COMMENT '数据提示',
  `code` varchar(50) NOT NULL COMMENT '数据字段',
  `fields` text COMMENT '数据组字段以及类型（json数据）',
  `sort` int DEFAULT NULL COMMENT '排序',
  `is_del` tinyint DEFAULT '0' COMMENT '排序',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `config_name` (`code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='【组合数据表】';

-- ----------------------------
-- Table structure for td_version_config
-- ----------------------------
DROP TABLE IF EXISTS `td_version_config`;
CREATE TABLE `td_version_config` (
  `id` int NOT NULL AUTO_INCREMENT,
  `type` varchar(255) DEFAULT NULL,
  `current_version_code` char(255) DEFAULT NULL,
  `new_version_code` char(255) DEFAULT NULL,
  `version_status` int DEFAULT NULL,
  `online_status` int DEFAULT NULL,
  `update_time` char(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='版本信息';

-- ----------------------------
-- Records of td_version_config
-- ----------------------------
BEGIN;
INSERT INTO `td_version_config` VALUES (1, 'config', '1.0.3', '1.0.0', 1, 1, NULL);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
